/*
 * Copyright 2020-2021 redragon.dongbin
 *
 * This file is part of redragon-erp/赤龙ERP.

 * redragon-erp/赤龙ERP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * redragon-erp/赤龙ERP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with redragon-erp/赤龙ERP.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.erp.masterdata.calendar.dao;

import java.util.Date;
import java.util.List;

import org.redragon.framework.hibernate.DaoCRUDIF;
import org.redragon.framework.hibernate.model.Pages;

import com.erp.masterdata.calendar.dao.model.MdFinanceCalendarPeriod;
import com.erp.masterdata.calendar.dao.model.MdFinanceCalendarPeriodCO;

public interface MdFinanceCalendarPeriodDao extends DaoCRUDIF<MdFinanceCalendarPeriod, MdFinanceCalendarPeriodCO>{
    
    //查询期间数量数量
    public abstract int getPeriodCountByCalendarCode(String calendarCode);
    
    //查询期间列表(分页)
    public abstract List<MdFinanceCalendarPeriod> getPeriodListByCalendarCode(Pages pages, MdFinanceCalendarPeriodCO paramObj);
    
    //更新行版本
    public abstract void updateLineForVersion(String code);
    
    //判断当前是否打开
    public abstract boolean isOpenedForPeriod(Integer periodId);
    
    //判断当前期间的之前的期间是否关闭
    public abstract boolean isClosedForPreviousPeriod(Integer periodId);
    
    //根据日期查询当前会计期间
    public abstract MdFinanceCalendarPeriod getPeriodNameByDate(Date date);
    
    //获取当前期间的前一期
    public abstract MdFinanceCalendarPeriod getPreviousPeriod(String periodName);
    
}